<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title></title>
    <!--覆盖上列样式  -->
    <link rel="stylesheet" href="res/layui/css/layui.css">
    <link rel="stylesheet" href="res/css/global.css">
    <link rel="stylesheet" href="res/css/style.css"/>
     <link rel="stylesheet" href="res/css/jqPaginator.css"/>
  <body >
 

   <div class="header">
      <div class="main">
         <a href="main.html"><img class="fl logoimg" src="res/images/fly.jpg"></a>
            <a class="title fl" href="#">
          我是学生</a>
         <a class="title fl" href="#"> 
          帮助中心</a>
       
        <div class="nav-user">

            <div class="fl user-header-top">
            <a class="lindang" href="">
            <img src="res/images/tx.png">
            </a>
         <div class="tanshow">
            <div class="triangle"></div>
          <div class="personal-fun ">

              <ul>
                  <li class="fun-list">
                      <a href="javascript:;">粉丝</a>
                  </li>
                  <li class="fun-list">
                      <a href="javascript:;">课程标签</a>
                  </li>
                  <li class="fun-list">
                      <a href="javascript:;">系统通知</a>
                  </li>
              </ul>
              </div>
             </div>
              </div>
            <div class="fl user-header-top">
            <a class="lindang "  href="">
            <img src="res/images/xx.png">
            </a>
                        <div class="tanshow">
            <div class="triangle"></div>
          <div class="personal-fun ">

              <ul>
                  <li class="fun-list">
                      <a href="javascript:;">私聊</a>
                  </li>
                  <li class="fun-list">
                      <a href="javascript:;">群聊</a>
                  </li>
               
              </ul>
              </div>
             </div>
            </div>
         <div class="fl user-header-top">
            <a   class="iconfont   icon-touxiang layui-hide-xs" style="margin-top: 4px; display: inline-block;">
            </a>

            <div class="tanshow">
            <div class="triangle"></div>
          <div class="personal-fun ">

              <ul>
                      <li class="fun-list">
                      <a href="setting.html">系统设置</a>
                  </li>
                  <li class="fun-list">
                      <a href="javascript:;">退出登录</a>
                  </li>
              </ul>
              </div>
             </div>
          </div>
        </div>
      </div>
    </div>




     <div class="risk_wrap" >
   <!--左侧导航开始-->
        <div class="risk_left fl">
            <!--头像开始-->
      <div class="risk_portrait over_flow">
                <div class="portrait_img">
                
                
                    <img src="res/images/FullSizeRender.png" id="openPortrait"
                        data-toggle="modal" data-target="#avatar-modal" alt=""/>
                
             <!--  <div class="mask5 mask1" style="display: none;" id="maskPortrait">
                <form id="updatePortraitForm" action="">
                    <div class="mask_wrap width520" id="formPortrait" style="display: none;">
                        <h3><span class="fl">上传头像</span><i class="mask_close fr" id="closePortrait"></i></h3>
                        <div class="mask_con over_flow mab20 mat30">
                            <div class="btn_mask margin_auto relative width380">
                                <input class="input_tupian fl" type="text" id="name">
                                <div class="input_btn fr relative">
                                    <input type="button" value="选择文件">
                                    <input class="" type="file" name="file" id="file" />
                                </div>
                                
                            </div>
                            <p class="margin_auto width380 mat10 font12 color_81">您可以上传JPG、GIF或PNG文件</p>
                            <div style="text-align: center;color: red;" id="message"></div>
                        </div>
                        <div class="btn_mask margin_auto relative width_275">
                            <span class="width_275"></span>
                            <a class="width_275 bg_0083c3" href="javascript:;" id="updatePortrait">上传</a>
                        </div>
                    </div>
                    </form>
                </div>   -->
                <input type="hidden" id="userMemberGradeId" value="1"/>
           <!--          <div class="grade" id="memberLevel">体验卡会员</div> -->
                </div>
                <p><span id="greetTxt"></span><span></span>大林</p>
                    <div class="huiid">所属机构：火星时代</div>
                    <div class="huiid">ID：21312</div>   
                 
                <div class="authentication">
                    <!--安全认证-->
                    <a href="#"><li><div>6</div><div>课程</div></li></a>
                    <!--手机认证-->
                    <a href="#"><li><div>23</div><div>粉丝</div></li></a>
                    <!--银行卡认证-->
                    <a href="#"><li><div>23</div><div>关注</div></li></a>
                </div>
                <div class="clear"></div>
               <a href="addclassstep.html" target="_blank"><div class="borderbutton">创建课程</div> </a>
            </div>
            <!--头像结束-->
            <!--菜单开始-->
            <div class="bordertop"></div>
            <ul class="risk_menu over_flow">
                  <li>         
                        <div data-open='1' class="menu_first menu_first_1 ">
                        <i></i>
                        <a class="fl" href="main.html">后台首页</a>
                    </div>
                   
                </li>
                  <li>
                    <div data-open='1' class="menu_first menu_first_2 ">
                 
                        <a class="fl" >基础管理</a>
                        <i class="icon fr risk_arrow"></i>
                    </div>
                    <div class="menu_second">
                    
                           <a href="renzhengcenter.html">认证中心</a>
                            <a href="tuanduicenter.html">团队主页</a>
                            <a href="chengyuangl.html">成员管理</a>
                        
                    </div>
                </li>
              <li>
                    <div data-open='1' class="menu_first menu_first_2 ">
                 
                        <a class="fl" >教学教务</a>
                        <i class="icon fr risk_arrow"></i>
                    </div>
                    <div class="menu_second">
                    
                              <a href="kechengrili.html">课程日历</a>
                            <a href="kechengguanli.html">课程管理</a>
                            <a href="cailiaoguanli.html">材料管理</a>
                            <a href="zuoyeguanli.html">作业管理</a>
                            <a href="pingjiaguanli.html">评价管理</a>
                    </div>
                </li>
                <li >
                
                        
                        <div data-open='1' class="menu_first menu_first_3">
                
                        <a class="fl">财务管理</a>
                            <i class="icon fr risk_arrow"></i>
                    </div>
                     <div class="menu_second">
                    
                     
                            <a href="myzhanghu.html"  class="act">我的账户</a>
                            <a href="jiesuanguanli.html">结算管理</a>
                            <a href="myorder.html">我的订单</a>
                     
                    </div>
                </li>
                <li>
                    <div data-open='1'  class="menu_first  menu_first_4">
                 
                        <a class="fl" >数据中心</a>
                        <i class="icon fr risk_arrow"></i>
                    </div>
                    <div class="menu_second">
                     
                              <a href="kechengdianji.html">课程点击量</a>
                            <a href="orderchengjiao.html">订单成交量</a>
                            <a href="chengjiaomoney.html">成交金额</a>
                            
                    </div>
                </li>
                <li>
                    <div data-open='1' class="menu_first  menu_first_5">
                     
                        <a class="fl" >营销推广</a>
                        <i class="icon fr risk_arrow"></i>
                    </div>
                    <div class="menu_second">
                        <a href="youhuiquan.html">优惠券管理</a>
                     
                    </div>
                </li>
                   <!--       <li>
                    <div data-open='1' class="menu_first  menu_first_6">
                     
                        <a class="fl" >我的账户</a>
                        <i class="icon fr risk_arrow"></i>
                    </div>
                    <div class="menu_second">       
                          <a href="zhanghuyue.html">账户余额</a>
                            <a href="myzhangdan.html">我的账单</a>
                            <a href="mycard.html">我的银行卡</a>
                            <a href="zhanghusetting.html">账户设置</a>

                    </div>
                </li> -->
                        <li >         
                        <div data-open='1' class="menu_first menu_first_1 ">
                        <i></i>
                        <a class="fl">个人中心</a>
                    </div>
                         <div class="menu_second ">
                       <a href="gerenzhuye.html">个人资料</a>
                     
                    </div>
                </li>
            </ul>
            <!--菜单结束-->
        </div>
     <!--右侧内容开始-->
        <div class="account_right fr" >

            <h3 class="risk_title"><span class="fl">我的账户</span><span class="fr">账户设置</span></h3>
            
   

   
  <div class="layui-tab-content basic_infor" >
  
          <div class="shipingkecheng">共88个订单</div>
          <div class="layui-form news_list">
          <table class="layui-table">
            <colgroup>
            <!--     <col width="2%">    
                         -->
                <col width="15%">
                <col width="70%">
                <col width="25%">
              
            
            </colgroup>
            <thead>
                <tr>
                  <!--   <th><input type="checkbox" name="" lay-skin="primary" lay-filter="allChoose" id="allChoose"></th>
                 -->
                    <th>时间</th>
                    <th>交易内容/对方信息/流水号</th>                  
                    <th>交易金额</th>
                </tr> 
            </thead>
            <tbody class="news_content">
               <tr>
                <td>2018-11-01 09:20</td>
                <td>交易内容/对方信息/流水号</td>
                <td>+900</td>
               </tr>         
                 <tr>
                 <td>2018-11-01 09:20</td>
                <td>交易内容/对方信息/流水号</td>
                <td>+900</td>
               </tr> 
            </tbody>
        </table>
    </div>
    <div style="width: 100%;padding: 0px; text-align: center;" id="pa_one">
    <div style="margin:0 auto">
        <ul class="pagination" id="pageTag" style="vertical-align: middle;"></ul>
    </div>
    <input type="hidden" id="pageNumber" name="pageNum"/>
     </div>
   

  
  </div>




          

                  
        </div>
        <!--右侧内容结束-->
    </div>
<!-- 
<div id="chongzhi" class="white_content">

       <div class="con">
         <p>充&nbsp;&nbsp;值</p>
         <div class="cont">
       <div class="error"></div>
        <div class="p">可用金额（元）:12323</div>
        <div class="p">充值金额（元）:
        <input type="text" name="czje" placeholder="请输入充值金额"/></div>
        <div class="confirm_cha" id='qdcz'>确定充值</div>  
         <div class="center1"><input class="checkbox" type="checkbox" />我已经同意并阅读《小何在线用户服务协议》。</div>
      </div>
      </div>
</div> -->



  <div class="black_overlay"></div>


  <!-- 底部结束 -->
    <!--账户总览结束-->

<script src="res/layui/layui.js"></script>
 <script src="res/js/jquery-1.9.1.min.js"></script>
 <script src="res/js/script.js"></script>
 <script src="res/js/jqPaginator.min.js"></script>
 <script>

layui.use(['form', 'layer', 'jquery', 'laypage', 'laydate', 'layedit', 'element'],function(){
    var form = layui.form,
     layer = parent.layer === undefined ? layui.layer : parent.layer,
        laypage = layui.laypage,
        laydate = layui.laydate,
          layedit = layui.layedit
  ,element = layui.element;
        $ = layui.jquery;


    //加载页面数据
    $(function () {
        // ininPage()
    })
    var view_isClick = true;

    function ininPage(keyword) {
        $('#pageTag').jqPaginator({
            totalCounts: 100,
            pageSize: 10,
            currentPage: 1,
            visiblePages: 5,
            activeClass: 'active',

            first: '<li class="first"><a href="javascript:void(0);">&laquo;</a></li>',
            prev: '<li class="prev"><a href="javascript:void(0);">&lsaquo;</a></li>',
            next: '<li class="next"><a href="javascript:void(0);">&rsaquo;</a></li>',
            last: '<li class="last"><a href="javascript:void(0);">&raquo;</a></li>',
            page: '<li class="page"><a href="javascript:void(0);">{{page}}</a></li>',
            onPageChange: function (num) {
                $("#pageNumber").val(num);
                user_list(keyword);

            }
        });
    }

    function user_list(keyword) {
        var dataHtml = '';
        var pageNum = $("#pageNumber").val();
        var token = JSON.parse(sessionStorage.getItem('token'));
        var customerId=GetQueryString('id')
            if (token == '' || token == null) {
            //alert('请先登录');
            top.location.href = wet_root_url+"/page/login/login.html";
            return;
        }
        var ajaxData = {
            "size": 10,
            "page": pageNum,
            "Token": token
        }
            if (customerId != null) {
            ajaxData.customerId = customerId;
        }
        if (keyword != null) {
            ajaxData.keyword = keyword;
        }
        $.ajax({
            url: api_root_url + '/contacts/list',
            type: 'POST',
            dataType: 'json',
            data: ajaxData,
            async: false,
            success: function (data) {


                if(!commonfn(data)) {
                    return false;
                }else if (data.code == 0) {
                    var list = data.data.list;
                    console.log(list)
                    if (list != null&&list.length>0) {
                        for (var i = 0; i < list.length; i++) {
                            //显示分页控件
                            $('#pa_one').show()
                            dataHtml += '<tr>';
                            dataHtml += '<td><input type="checkbox" value="' + list[i].id + '" name="checked" lay-skin="primary" lay-filter="choose"></td>';
                            // dataHtml += '<td>' + (i + 1) + '</td>';
               

                           
                              dataHtml += '<td>' + list[i].name + '</td>';
                           
                              if (list[i].mobile==null||list[i].mobile==''||list[i].mobile==undefined) {
                                    dataHtml += '<td></td>';
                              }else{
                                   dataHtml += '<td>' + list[i].mobile + '</td>';
                              };
                  
                                if (list[i].payment==null||list[i].payment==''||list[i].payment==undefined) {
                                    dataHtml += '<td></td>';
                              }else{
                                   dataHtml += '<td>' + list[i].payment + '</td>';
                              };

                              dataHtml += '<td>' + list[i].cusName + '</td>';
                              dataHtml += '<td>' + list[i].CusPhone + '</td>';

                            dataHtml += "<td>";
                            dataHtml += "<a class='layui-btn  layui-btn-mini newsUp_btn'><input type='hidden' class='userDetail' value='" + list[i].id + "'>编辑</a>";
                           
                            dataHtml += '</td>';
                            dataHtml += '</tr>';
                        }


                        $('#pageTag').jqPaginator('option', {
                            totalCounts: data.data.totalPage * 10,
                            pageSize: 10,
                            // currentPage:dataval['pageNum'
                        });
                    } else if (list == null || list.length == 0) {
                
                        //console.log("没数据")
                        $('#pa_one').hide()
                        dataHtml = '<tr><td colspan="9">暂无数据</td></tr>';
                    }
                    $('.news_content').html(dataHtml)


                    form.render();


                }
            }

        });
    }



    $("body").on("click", ".newsUp_btn", function () {
        var Id = $(this).find('.userDetail').val()
        // sessionStorage.removeItem('jiushitype');
        sessionStorage.setItem('tgsId', Id);
         var customerId=GetQueryString('id')
        // sessionStorage.removeItem('xuangsId');
        // sessionStorage.removeItem('xuangsname');
        // sessionStorage.removeItem('quanxianId');
            var index = layui.layer.open({
            title: "编辑联系人",
            type: 2,
            // area: ['580px', '650px'],
            content: "contactxingxiAdd.html?id="+customerId,
          //   end: function(){
          //     location.reload();
          // }

        });
     

        //改变窗口大小时，重置弹窗的高度，防止超出可视区域（如F12调出debug的操作）
        $(window).resize(function () {
            layui.layer.full(index);
        })
        layui.layer.full(index);

    })
    $("body").on("click", ".caidanquanxian", function () {
        var Id = $(this).find('.userDetail').val()
        sessionStorage.setItem('quanxianId', Id);
        sessionStorage.removeItem('xuangsId');
        sessionStorage.removeItem('xuangsname');
        sessionStorage.removeItem('tgsId');
        var index = layui.layer.open({
            title: "菜单权限",
            type: 2,
            content: "quanxian.html",
            // success : function(layero, index){
            //  layui.layer.tips('点击此处返回账户管理', '.layui-layer-setwin .layui-layer-close', {
            //      tips: 3
            //  });
            // }
        })
        //改变窗口大小时，重置弹窗的高度，防止超出可视区域（如F12调出debug的操作）
        $(window).resize(function () {
            layui.layer.full(index);
        })
        layui.layer.full(index);

    })
    //查询
    $(".search_btn").click(function () {
        var newArray = [];
        if ($(".search_input").val() != '') {
            var index = layer.msg('查询中，请稍候', {icon: 16, time: false, shade: 0.8});
            ininPage($("#keyword").val());
            layer.close(index);
        } else {
            //top.layer.msg("请输入搜索条件");
            //return false;
            ininPage(null);
        }
    })





    function deleteUser(status, id) {
        var token = JSON.parse(sessionStorage.getItem('token'));
             var customerId=GetQueryString('id')
        if (customerId==null) {
                    $.ajax({
            url: api_root_url +"/contacts/del",
            type: 'POST',
            dataType: 'json',
            data: {
                   "Token": token,
                    "id": id,
                
            },
            success: function (data) {
                user_list($("#keyword").val());
            }
        })

        }else{
                    $.ajax({
            url: api_root_url +"/contacts/del",
            type: 'POST',
            dataType: 'json',
            data: {
                   "Token": token,
                    "id": id,
                    "customerId": customerId,
                
            },
            success: function (data) {
                user_list($("#keyword").val());
            }
        })

        }

         
    }

    //添加组织机构
    //改变窗口大小时，重置弹窗的高度，防止超出可视区域（如F12调出debug的操作）
    $("body").on("click", ".newsAdd_btn", function () {
        // sessionStorage.removeItem('xuangsId');
        // sessionStorage.removeItem('xuangsname');
        // sessionStorage.removeItem('quanxianId');
        sessionStorage.removeItem('tgsId');
 var customerId=GetQueryString('id')
        var index = layui.layer.open({
            title: "新增联系人",
            type: 2,
            // area: ['580px', '650px'],
            content: "contactxingxiAdd.html?id="+customerId,
          //   end: function(){
          //     location.reload();
          // }

        });
     

        //改变窗口大小时，重置弹窗的高度，防止超出可视区域（如F12调出debug的操作）
        $(window).resize(function () {
            layui.layer.full(index);
        })
        layui.layer.full(index);
    })

       //已发布删除
    $(".batchDely").click(function () {
        // var $checkbox = $('.news_list tbody input[type="checkbox"][name="checked"]');
        // var $checked = $('.news_list tbody input[type="checkbox"][name="checked"]:checked');
        // if ($checkbox.is(":checked")) {
            layer.confirm('该课程已发布，删除后所有课程信息将不再保留', { title: '确定删除该课程吗？', btn : ['删除', '取消' ]}, function (index) {
                var index = layer.msg('删除中，请稍候', {icon: 16, time: false, shade: 0.8});
                for (var i = 0; i < $checked.length; i++) {
                    var id = $checked[i].value;
                    deleteUser(0, id);
                }

                form.render();
                layer.close(index);
                layer.msg("删除成功");
                
            })
        // } else {
        //     layer.msg("请选择需要删除的内容");
        // }
    })
           //未发布删除
    $(".batchDelw").click(function () {
        // var $checkbox = $('.news_list tbody input[type="checkbox"][name="checked"]');
        // var $checked = $('.news_list tbody input[type="checkbox"][name="checked"]:checked');
        // if ($checkbox.is(":checked")) {
            layer.confirm('删除后所有课程信息将不再保留', { title: '确定删除该课程吗？', btn : ['删除', '取消' ]}, function (index) {
                var index = layer.msg('删除中，请稍候', {icon: 16, time: false, shade: 0.8});
                for (var i = 0; i < $checked.length; i++) {
                    var id = $checked[i].value;
                    deleteUser(0, id);
                }

                form.render();
                layer.close(index);
                layer.msg("删除成功");
                
            })
        // } else {
        //     layer.msg("请选择需要删除的内容");
        // }
    })
       //上架
    $(".shangjia").click(function () {
        // var $checkbox = $('.news_list tbody input[type="checkbox"][name="checked"]');
        // var $checked = $('.news_list tbody input[type="checkbox"][name="checked"]:checked');
        // if ($checkbox.is(":checked")) {
            layer.confirm('上架课程需经审核，工作人员将在1个工作日内审核课程材料，请您耐心等待', { title: '确定上架该课程吗？', btn : ['上架', '取消' ]}, function (index) {
                var index = layer.msg('上架中，请稍候', {icon: 16, time: false, shade: 0.8});
                for (var i = 0; i < $checked.length; i++) {
                    var id = $checked[i].value;
                    deleteUser(0, id);
                }

                form.render();
                layer.close(index);
                layer.msg("上架成功");
                
            })
        // } else {
        //     layer.msg("请选择需要删除的内容");
        // }
    })

       //下架
    $(".xiajia").click(function () {
        // var $checkbox = $('.news_list tbody input[type="checkbox"][name="checked"]');
        // var $checked = $('.news_list tbody input[type="checkbox"][name="checked"]:checked');
        // if ($checkbox.is(":checked")) {
            layer.confirm('该课程已发布，下架后所有课程信息将设为私密，您可到“未发布”课程中重新申请上架', { title: '确定下架该课程吗？', btn : ['删除', '取消' ]}, function (index) {
                var index = layer.msg('下架中，请稍候', {icon: 16, time: false, shade: 0.8});
                for (var i = 0; i < $checked.length; i++) {
                    var id = $checked[i].value;
                    deleteUser(0, id);
                }

                form.render();
                layer.close(index);
                layer.msg("下架成功");
                
            })
        // } else {
        //     layer.msg("请选择需要删除的内容");
        // }
    })


    //取消上架
    $(".cancelsj").click(function () {
        // var $checkbox = $('.news_list tbody input[type="checkbox"][name="checked"]');
        // var $checked = $('.news_list tbody input[type="checkbox"][name="checked"]:checked');
        // if ($checkbox.is(":checked")) {
            layer.confirm('该课程等待审核中，取消上架您可到“未发布”课程中重新申请上架', { title: '您要取消上架该课程吗？', btn : ['确定', '取消' ]}, function (index) {
                var index = layer.msg('取消中，请稍候', {icon: 16, time: false, shade: 0.8});
                for (var i = 0; i < $checked.length; i++) {
                    var id = $checked[i].value;
                    deleteUser(0, id);
                }

                form.render();
                layer.close(index);
                layer.msg("取消成功");
                
            })
        // } else {
        //     layer.msg("请选择需要删除的内容");
        // }
    })
  
  
    //批量停用
    $(".batchStop").click(function () {
        var $checkbox = $('.news_list tbody input[type="checkbox"][name="checked"]');
        var $checked = $('.news_list tbody input[type="checkbox"][name="checked"]:checked');
        if ($checkbox.is(":checked")) {
            layer.confirm('确定停用选中的信息？', { title: '提示信息'}, function (index) {
                var index = layer.msg('停用中，请稍候', {icon: 16, time: false, shade: 0.8});
                for (var i = 0; i < $checked.length; i++) {
                    var id = $checked[0].value;
                    deleteUser(2, id);
                }

                form.render();
                layer.close(index);
                layer.msg("停用成功");
                user_list($("#keyword").val());
            })
        } else {
            layer.msg("请选择需要停用的用户");
        }
    })

    $(".batchStart").click(function () {
        var $checkbox = $('.news_list tbody input[type="checkbox"][name="checked"]');
        var $checked = $('.news_list tbody input[type="checkbox"][name="checked"]:checked');
        if ($checkbox.is(":checked")) {
            layer.confirm('确定启用选中的信息？', { title: '提示信息'}, function (index) {
                var index = layer.msg('启用中，请稍候', {icon: 16, time: false, shade: 0.8});
                for (var i = 0; i < $checked.length; i++) {
                    var id = $checked[0].value;
                    deleteUser(1, id);
                }

                form.render();
                layer.close(index);
                layer.msg("启用成功");
                user_list($("#keyword").val());
            })
        } else {
            layer.msg("请选择需要启用的用户");
        }
    })


    //全选
    form.on('checkbox(allChoose)', function (data) {
        var child = $(data.elem).parents('table').find('tbody input[type="checkbox"]:not([name="show"])');
        child.each(function (index, item) {
            item.checked = data.elem.checked;
        });
        form.render('checkbox');
    });

    //通过判断组织机构是否全部选中来确定全选按钮是否选中
    form.on("checkbox(choose)", function (data) {
        var child = $(data.elem).parents('table').find('tbody input[type="checkbox"]:not([name="show"])');
        var childChecked = $(data.elem).parents('table').find('tbody input[type="checkbox"]:not([name="show"]):checked')
        if (childChecked.length == child.length) {
            $(data.elem).parents('table').find('thead input#allChoose').get(0).checked = true;
        } else {
            $(data.elem).parents('table').find('thead input#allChoose').get(0).checked = false;
        }
        form.render('checkbox');
    })


})
</script>
</body>
</html>